var MoveEditor = {
	obj : false,
	tmpo : false,
	orx : 0,ory : 0,
	savedstatus : false,
	clearpx : function (stro){
		str=""+stro+"";
		return (str.replace("px",""))*1;
	},
	
	exiting : function(e){
		if (e.keyCode==27){
			ob1=this.obj;
			eventh.del(document,"click",MoveEditor.clicking);
			eventh.del(document,"mousemove",MoveEditor.moving);
			eventh.del(document,"keypress",MoveEditor.exiting);
			MoveEditor.obj.style.top=MoveEditor.ory;
			MoveEditor.obj.style.left=MoveEditor.orx;
			MoveEditor.obj=false;
			status="Done!";
			for (var i=0;i<document.getElementsByTagName("div").length;i++){
				if(!document.getElementsByTagName("div")[i].aux)
				document.getElementsByTagName("div")[i].style.visibility="visible";
			}
			MoveEditor.tmpo.style.visibility="hidden";
			MoveEditor.tmpo = false;
			TimeShow.started=MoveEditor.savedstatus;
			document.body.style.cursor="";
			try{if(ActiveXObject)parent.deltray();}catch(ex){}
		}
	},

	moving : function(e){
		MoveEditor.tmpo.style.top=(e.clientY)-(MoveEditor.clearpx(MoveEditor.tmpo.style.height)/2);
		MoveEditor.tmpo.style.left=(e.clientX)-(MoveEditor.clearpx(MoveEditor.tmpo.style.width)/2);
		status = MoveEditor.tmpo.style.left + "," + MoveEditor.tmpo.style.top;
		eventh.del(document,"click",MoveEditor.clicking);
		eventh.handle(document,"click",MoveEditor.clicking);
	},
	
	clicking : function(e){
		if (!e.pageX){
			e.pageX=e.clientX;
			e.pageY=e.clientY;
		}
		TimeShow.addMove(MoveEditor.obj,MoveEditor.clearpx(e.pageX), MoveEditor.clearpx(e.pageY),MoveEditor.clearpx(MoveEditor.obj.style.height),MoveEditor.clearpx(MoveEditor.obj.style.width),false);
		status="Pointed!!";
		eventh.del(document,"click",MoveEditor.clicking);
		try{if (ActiveXObject){
			parent.deltray();
			try{parent.drawtray(MoveEditor.obj.oid);}catch(ex){errors.record(ex);}
		}}catch(ey){}
	},
	
	smoves : function(ob1){
		if (this.obj)return;
		for (var i=0;i<document.getElementsByTagName("div").length;i++){
			if(!document.getElementsByTagName("div")[i].aux)
			document.getElementsByTagName("div")[i].style.visibility="hidden";
		}
		var tob = document.getElementById("tob");
		tob.innerHTML = ob1.innerHTML;
		tob.style.top = ob1.style.top;
		tob.style.left = ob1.style.left;
		this.ory = ob1.style.top;
		this.orx = ob1.style.left;
		tob.style.height = ob1.style.height;
		tob.style.width = ob1.style.width;
		tob.style.visibility = "visible";
		this.tmpo = tob;
		this.savedstatus = TimeShow.started;
		this.obj = ob1;
		eventh.del(document,"mousemove",SEditor.rsize);
		try{
			ob1.style.top=PEditor.oy;
			ob1.style.left=PEditor.ox;
		}catch(e){errors.record(e,"MoveEditor.smoves->ob1 style = PEditor");}
		eventh.del(document,"mousemove",PEditor.follow);
		eventh.handle(document,"mousemove",MoveEditor.moving);
		eventh.handle(document,"keypress",MoveEditor.exiting);
		status="Select Target!";
		document.body.style.cursor="crosshair";
		try{if(ActiveXObject){
			parent.deltray();
			if(ob1.oid)parent.drawtray(ob1.oid);
		}}catch(e){}
	}
}